let moment =require('moment')
function Wx_msg_tpl() {
    this.type = {
        release:{

        },
        job:{

        }
    }
}

Wx_msg_tpl.prototype = {

    /**
     * 发布成功通知
     * @param touser
     * @param title
     * @param sub
     * @returns {{touser: string, template_id: string, url: string, data: {first: {value: string, color: string}, keyword1: {value: string, color: string}, keyword2: {value: string, color: string}, remark: {value: string, color: string}}}}
     */
    task_create_success:function (touser="",first="",name="",status="",remark="") {
        let d = {
           /* content: "{{first.DATA}} 兼职名称：{{keyword1.DATA}} 审核结果：{{keyword2.DATA}} {{remark.DATA}}",
            example: "您提交的兼职信息已经审核完毕 兼职名称：奥林匹克公园游客引导 审核结果：通过 点击查看兼职页面"*/
            "touser":touser,
            "template_id": "-_pou-ArL2NNFgIEBoBByOYg1ITw_5_Hay1hE8csoqE",
            "url": "",
            "data": {
                "first": {
                    "value": first,
                    "color": "#173177"
                },
                "keyword1": {
                    "value": name,
                    "color": "#173177"
                },
                "keyword2": {
                    "value":status,
                    "color": "#173177"
                },
                "remark":{
                    "value":moment(new Date()).format('YYYY-MM-Do').toString(),
                    "color": "#173177"
                }
            }
        };
        return d;

    },

    /**
     * 任务授权提醒
     * @param touser
     * @param first
     * @param user
     * @param status
     * @returns {{touser: string, template_id: string, url: string, data: {first: {value: string, color: string}, keyword1: {value: string, color: string}, keyword2: {value: string, color: string}, remark: {value: string, color: string}}}}
     */
    task_sigin:function (touser="",first="",name="",status="") {
        let d = {
            "touser":touser,
            "template_id": "KdD953qugbv102SaGY_8hZVg9HOTeYC92U4F198ea1o",
            "url": "",
            "data": {
                "first": {//"尊敬的白帽子，您的项目申请状态已更新。
                    "value":first,
                    "color": "#173177"
                },
                "keyword1": { //项目名称：某网站安全测试
                    "value": name,
                    "color": "#173177"
                },
                "keyword2": {//申请状态：已通过
                    "value":status,
                    "color": "#173177"
                },
                "remark":{//项目申请通过审核，请登录漏洞盒子参加项目。"
                    "value":"项目申请通过审核,请登录知行兼职参与项目",
                    "color": "#173177"
                }
            }
        };
        return d;

    },

    /**
     * 目标完成待确认提醒"
     * @param touser
     * @param first
     * @param user
     * @param status
     * @returns {{touser: string, template_id: string, url: string, data: {first: {value: string, color: string}, keyword1: {value: string, color: string}, keyword2: {value: string, color: string}, remark: {value: string, color: string}}}}
     */
    task_finish:function (touser="",first="",content="",type="",user,remark) {
        let d = {
            "touser":touser,
            "template_id": "ZkvZDtOEC6wYwMlJqY6PLOJriMXTOr9Mw6xyVQIMpnA",
            "url": "",
            "data": {
                "first": {//"你有新的目标完成待确认。 。
                    "value":first,
                    "color": "#173177"
                },
                "keyword1": { //目标内容：高保真设计
                    "value": content,
                    "color": "#173177"
                },
                "keyword2": {//完成时间：15/6/5 周五 12:00
                    "value":moment(new Date()).format('YYYY-MM-Do').toString(),
                    "color": "#173177"
                },
                "keyword3": {//所属项目：物业后台系统
                    "value":type,
                    "color": "#173177"
                },
                "keyword4": {//完成人：李嘉慧
                    "value":user,
                    "color": "#173177"
                },
                "remark":{//请尽快进行完成确认，谢谢！"
                    "value":remark,
                    "color": "#173177"
                }
            }
        };
        return d;

    },
    /**
     * 验收结果通知
     * @param touser
     * @param first
     * @param content
     * @param type
     * @param user
     * @param remark
     * @returns {{touser: string, template_id: string, url: string, data: {first: {value: string, color: string}, keyword1: {value: string, color: string}, keyword2: {value: string, color: string}, keyword3: {value: string, color: string}, keyword4: {value: *, color: string}, remark: {value: *, color: string}}}}
     */
    task_finish2:function (touser="",first="",content="",status="",user="",remark="") {
        let d = {
            "touser":touser,
            "template_id": "EJtgZ-ZYGHGaMmKgxxvNSImGgmD3cw9XidnuV6oGn3s",
            "url": "",
            "data": {
                "first": {//""您好,验收结果通知。 。
                    "value":first,
                    "color": "#173177"
                },
                "keyword1": { // 验收内容：制作新年祝福贺卡任务
                    "value": content,
                    "color": "#173177"
                },
                "keyword2": {//验收结果：雇主已经验收成功!
                    "value":status,
                    "color": "#173177"
                },
                "keyword3": {//验收人：小弋
                    "value":user,
                    "color": "#173177"
                },
                "keyword4": {//验收时间：2017年12月31日 18:36
                    "value":moment(new Date()).format('YYYY-MM-Do').toString(),
                    "color": "#173177"
                },
                "remark":{//感谢您的使用."
                    "value":remark,
                    "color": "#173177"
                }
            }
        };
        return d;

    },

    /**
     * 删除
     * @param touser
     * @param first
     * @param user
     * @param status
     * @returns {{touser: string, template_id: string, url: string, data: {first: {value: string, color: string}, keyword1: {value: string, color: string}, keyword2: {value: string, color: string}, remark: {value: string, color: string}}}}
     */
    task_delete:function (touser="",first="",user="",status="") {
        let d = {
            "touser":touser,
            "template_id": "",
            "url": "",
            "data": {
                "first": {
                    "value":"",
                    "color": "#173177"
                },
                "keyword1": {
                    "value": user,
                    "color": "#173177"
                },
                "keyword2": {
                    "value":status,
                    "color": "#173177"
                },
                "remark":{
                    "value":"审核时间:"+moment(new Date()).format('YYYY-MM-Do').toString(),
                    "color": "#173177"
                }
            }
        };
        return d;

    },

}
var wx_msg_tpl = new Wx_msg_tpl();

module.exports = wx_msg_tpl;

var list = {
    template_list: [
        {
            template_id: "zLOkHkzdlo_pJQQpS5SXWlosrPcruuBNwFEoySBm6lk",
            title: "订阅模板消息",
            primary_industry: "",
            deputy_industry: "",
            content: "{{content.DATA}}",
            example: ""
        },
        {
            template_id: "-_pou-ArL2NNFgIEBoBByOYg1ITw_5_Hay1hE8csoqE",
            title: "兼职审核结果通知",
            primary_industry: "IT科技",
            deputy_industry: "互联网|电子商务",
            content: "{{first.DATA}} 兼职名称：{{keyword1.DATA}} 审核结果：{{keyword2.DATA}} {{remark.DATA}}",
            example: "您提交的兼职信息已经审核完毕 兼职名称：奥林匹克公园游客引导 审核结果：通过 点击查看兼职页面"
        },
        {
            template_id: "2ZMyVvCvnsrLH82-GCxfSoF9DSnaAmDxPh4WDCn9rYU",
            title: "任务删除通知",
            primary_industry: "IT科技",
            deputy_industry: "互联网|电子商务",
            content: "{{first.DATA}} 任务创建者：{{keyword1.DATA}} 任务标题：{{keyword2.DATA}} 删除原因：{{keyword3.DATA}} {{remark.DATA}}",
            example: "亲爱的用户，您创建的任务已被管理员删除： 任务创建者：风一样的美男子 任务标题：求一位像云一样的靓妹子共渡6.1佳节 删除原因：该任务不在本平台业务范畴之内，无法通过审核 请登录平台重新创建任务；"
        },
        {
            template_id: "rPx4IbH43J1RX4oZNgCpR20QRHZ_OV1a77xl6YzAFg4",
            title: "审核进度提醒",
            primary_industry: "IT科技",
            deputy_industry: "互联网|电子商务",
            content: "{{first.DATA}} 申报名称：{{keyword1.DATA}} 申报类型：{{keyword2.DATA}} 审核结果：{{keyword3.DATA}} {{remark.DATA}}",
            example: "你好，你的申报被驳回。 申报名称：申请奖学金 申报类型：奖项申报 审核结果：通过 奖学金管理委员会驳回申请，驳回理由：申报材料缺失。"
        },
        {
            template_id: "bEqO3adwqsbOdompBt-VSWZQ997hUbgEVk07yf5DplM",
            title: "申请通过提醒",
            primary_industry: "IT科技",
            deputy_industry: "互联网|电子商务",
            content: "{{first.DATA}} 申请人：{{keyword1.DATA}} 申请状态：{{keyword2.DATA}} {{remark.DATA}}",
            example: "你好，你的申请已通过 申请人：猫客网 申请状态：已通过 商城已开通点击申请开店进去自己的商城！"
        },
        {
            template_id: "KdD953qugbv102SaGY_8hZVg9HOTeYC92U4F198ea1o",
            title: "项目申请通知",
            primary_industry: "IT科技",
            deputy_industry: "互联网|电子商务",
            content: "{{first.DATA}} 项目名称：{{keyword1.DATA}} 申请状态：{{keyword2.DATA}} {{remark.DATA}}",
            example: "尊敬的白帽子，您的项目申请状态已更新。 项目名称：某网站安全测试 申请状态：已通过 项目申请通过审核，请登录漏洞盒子参加项目。"
        },
        {
            template_id: "ZkvZDtOEC6wYwMlJqY6PLOJriMXTOr9Mw6xyVQIMpnA",
            title: "目标完成待确认提醒",
            primary_industry: "IT科技",
            deputy_industry: "互联网|电子商务",
            content: "{{first.DATA}} 目标内容：{{keyword1.DATA}} 完成时间：{{keyword2.DATA}} 所属项目：{{keyword3.DATA}} 完成人：{{keyword4.DATA}} {{remark.DATA}}",
            example: "你有新的目标完成待确认。 目标内容：高保真设计 完成时间：15/6/5 周五 12:00 所属项目：物业后台系统 完成人：李嘉慧 请尽快进行完成确认，谢谢！"
        },
        {
            template_id: "EJtgZ-ZYGHGaMmKgxxvNSImGgmD3cw9XidnuV6oGn3s",
            title: "验收结果通知",
            primary_industry: "IT科技",
            deputy_industry: "互联网|电子商务",
            content: "{{first.DATA}} 验收内容：{{keyword1.DATA}} 验收结果：{{keyword2.DATA}} 验收人：{{keyword3.DATA}} 验收时间：{{keyword4.DATA}} {{remark.DATA}}",
            example: "您好,验收结果通知 验收内容：制作新年祝福贺卡任务 验收结果：雇主已经验收成功! 验收人：小弋 验收时间：2017年12月31日 18:36 感谢您的使用."
        }
    ]
}
